<?php

use App\Http\Controllers\Api\Admin\AuthController;
use App\Http\Controllers\Api\Admin\DashboardController;
use Illuminate\Support\Facades\Route;

// 后台api
Route::group(['prefix' => 'admin', 'as' => 'admin.'], function() {
    // 注册、登陆、退出
    Route::controller(AuthController::class)->group(function() {
        Route::post('login', 'postLogin')->name('login.post');
        Route::get('logout', 'logout')->middleware(['auth:admin', 'set.team.id:admin'])->name('logout');
    });

    // 后台中心
    Route::middleware(['auth:admin', 'set.team.id:admin'])->group(function() {

        Route::get('dashboard', [DashboardController::class, 'dashboard'])->name('dashboard');
    });
});
